// 定义 InitMyApp 方法签名
import 'dart:async';
import 'dart:io';
import 'dart:isolate';

init() async {
  // 创建一个控制通信的 ReceivePort
  final receivePort = ReceivePort();
  // 启动 Isolate
  await Isolate.spawn(runServerInIsolate, receivePort.sendPort);
  print("Server started in a new isolate...");
}

Future<void> runServerInIsolate(SendPort sendPort) async {
  Process.run('backend_service.exe', []);
}
